from apps.chat.conversation.baseViews import *
from apps.chat.conversation.dao import ConversationDao

class ConversationViewSet(BaseConversationViewSet):

    def get_queryset(self):
        params = getRequestParams(self.request)
        _list = ConversationDao().findAll().filter(Q(userA=self.request.user) | Q(userB=self.request.user))
        _list = _list.select_related('userA', 'userB')
        return _list.order_by('-conversationType', '-lastMessage__createTime')
